package com.bdqn.ch03.service;

import com.bdqn.ch03.dao.NewDao;
import com.bdqn.ch03.dao.impl.NewsDaoImpl;
import com.bdqn.ch03.factory.SimpleDaFactory;
import com.bdqn.ch03.pojo.News;

public class NewsServiceImpl implements  NewsService{
//    NewDao newDao = new NewsDaoImpl();
    private NewDao dao;

//    private NewDao dao = SimpleDaFactory.getInstance();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    @Override
    public void save(News news) {
        dao.save(news);
    }
    public void setDao(NewDao dao) {
        this.dao = dao;
    }
    public void addNews(News news) {
        dao.save(news);
    }
}
